<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:x="http://www.xseam.org"
    template="/WEB-INF/layout/bootstrap.xhtml">

<ui:define name="metadata">
	<f:metadata>
    	<f:viewParam name="cpf" value="#{estudanteAction.cpf}"/>
        <f:event type="preRenderView" listener="#{estudanteAction.load()}"/>
	</f:metadata>
</ui:define>

<ui:define name="container">

    <div class="page-header">
	  <h3>#{estudanteAction.managed ? 'Editar' : 'Adicionar'} Estudante</h3>
	  
      <h:form id="estudante">
        
          <x:inputText id="cpf" label="CPF" value="#{estudanteAction.instance.cpf}" required="true" rendered="#{!estudanteAction.managed}"/>
          <x:outputText id="cpfOutput" label="CPF" value="#{estudanteAction.instance.cpf}" required="true" rendered="#{estudanteAction.managed}"/>
          <div style="clear: both;" />
        
          <x:inputText id="nome" label="Nome" value="#{estudanteAction.instance.nome}" required="true" />
          <div style="clear: both;" />
          
          <x:inputText id="mae" label="Nome da mãe" value="#{estudanteAction.instance.mae}" required="true" />
          <div style="clear: both;" />
          
          <div class="form-actions">
                <h:commandButton id="save" value="Salvar" action="#{estudanteAction.salvar()}" styleClass="btn btn-primary"/>
                <span style="margin-right: 3px;"></span>
                <a title="Cancelar" href="#{x:contextPath()}/EstudanteList.jsf" class="btn">Cancelar</a>
		  </div>
      </h:form>
	</div>

</ui:define>

</ui:composition>
